Skip to content

ci(lint): adopt golangci-lint v2.14.0 tooling and strict lint config - #46

Merged
appleboy merged 1 commit into
masterfrom
chore/golangci-lint-tooling
Oct 3, 2026
Merged

appleboy merged 1 commit into
masterfrom
chore/golangci-lint-tooling

Conversation

@appleboy

@appleboy appleboy commented Oct 3, 2026

Copy link
Copy Markdown
Member

Summary

Adopt project-managed golangci-lint tooling (same approach as go-signet/signet) across build, lint config, and CI:

flowchart LR
    A[go.tools.mod<br/>pin golangci-lint v2.14.0] --> B[Makefile<br/>make lint / make fmt]
    B --> C[.golangci.yml<br/>strict v2 config]
    C --> D[GitHub Actions<br/>make install-tools lint]
    D --> E[Code fixes<br/>0 lint issues]
Loading

Additions

  • .golangci.yml — strict golangci-lint v2 configuration (bidichk, gocritic, modernize, revive, testifylint, perfsprint, staticcheck, etc.) with module-specific gci import ordering
  • Makefile — lint, fmt, test, coverage, mod-download/tidy/verify, install-tools, help targets
  • go.tools.mod / go.tools.sum — pin golangci-lint v2.14.0 via Go tool directive, executed with go tool -modfile=go.tools.mod

CI changes

  • Replace golangci/golangci-lint-action with make install-tools lint so local and CI use the exact same pinned version

Code fixes (all lint issues resolved: 0 issues)

  • Automated: modernize (interface{} → any, range over int, maps.Copy), usestdlibvars (http.MethodGet), perfsprint, testifylint (assert → require), usetesting (os.MkdirTemp → t.TempDir)
  • Manual: dead code removal, unused imports, builtin shadowing fixes
  • Public API names kept unchanged (e.g. exported funcs/fields) via //nolint directives with explanations for backward compatibility

AI Authorship Disclosure

🤖 This change was prepared with AI assistance. Generated with Claude Code.

Change Classification

  • Type: ci (tooling/CI) + style/refactor (lint fixes)
  • Scope: build/lint tooling, CI workflow, lint-driven code cleanup
  • Impact: No public API changes; no behavior changes

Checklist

  • make lint passes with 0 issues
  • Tests pass locally for affected repos
  • Public API names preserved for backward compatibility
  • CI workflow updated to use make lint

- Add .golangci.yml based on the signet strict configuration with module-specific gci prefix
- Add Makefile with lint, fmt, test, coverage and mod targets
- Pin golangci-lint v2.14.0 via go.tools.mod with tool directive
- Replace golangci-lint-action with make install-tools lint in CI workflow
- Apply automated lint fixes: modernize, usestdlibvars, perfsprint, testifylint
- Keep public API names unchanged via nolint directives for backward compatibility
- Replace os.MkdirTemp with t.TempDir in tests
- Clean up dead code and unused imports flagged by staticcheck and govet

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Code <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 01:06
@appleboy
appleboy merged commit 0f9a6fd into master Oct 3, 2026
7 checks passed
@appleboy
appleboy deleted the chore/golangci-lint-tooling branch October 3, 2026 01:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The tooling integration is consistent and the source changes preserve existing behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Adopts project-managed golangci-lint v2.14.0 tooling and applies lint-driven, behavior-preserving cleanup.

Changes:

  • Adds pinned lint tooling, Make targets, and strict lint/format configuration.
  • Updates CI to invoke the project-managed linter.
  • Applies formatting and modernization fixes across implementation and tests.
File Description
.github/​workflows/​go.yml Runs lint through Make.
.golangci.yml Defines strict v2 lint and formatting rules.
Makefile Adds development and CI targets.
go.tools.mod Pins golangci-lint tooling.
go.tools.sum Locks tool dependencies.
authenticator.go Modernizes header lookup logic.
authenticator_test.go Applies formatting and test assertion improvements.
signatureheader_test.go Formats cases and uses HTTP constants.
crypto/​crypto.go Groups same-type parameters.
crypto/​hmacsha256.go Groups same-type parameters.
crypto/​hmacsha512.go Groups same-type parameters.
validator/​datevalidate.go Simplifies error-string construction.
validator/​digestvalidate.go Removes unreachable error handling and simplifies formatting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants